/**
 * 上架菜品
 */

//引入Q模块
var Q = require('q');

//push入口函数
var index = function(getData, postData, config, _redis, db) {
	var deferred = Q.defer();
	console.log('取得的上架菜单foodId' + postData.foodId);
	//更新对应foodId的项
	db.update('foodMenu', {foodId: postData.foodId}, {foodStatus: 'pushed'}).then(function() {
		//上架菜品成功
		deferred.resolve(1);
	}, function() {
		//上架菜品失败
		deferred.reject('-0065');
	});
	return deferred.promise;
}
//暴露接口
module.exports = {
	index: index
};